<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

/**
 * 微信上行消息
 */
class CreateWxmsgSend extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('wxmsg_sends', function (Blueprint $table) {
            $table->increments('id')->comment('自增ID');
            $table->string('msg_type', 50)->default('')->comment('消息类型');
            $table->string('to_user_name', 150)->default('')->comment('接收方帐号');
            $table->string('from_user_name', 100)->default('')->comment('开发者微信号');
            $table->text('data')->nullable()->comment('回复数据');
            $table->timestamp('create_time')->comment('消息创建时间');
            $table->timestamps();
            $table->index(['to_user_name','create_time'], 'index1');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('wxmsg_sends');
    }
}
